import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:haokezufang/pages/home/index.dart';
import 'package:haokezufang/routes.dart';
import 'package:haokezufang/scoped_model/auth_login.dart';
import 'package:haokezufang/scoped_model/room_filter.dart';
import 'package:scoped_model/scoped_model.dart';

class Application extends StatefulWidget {
  const Application({super.key});
  @override
  State<StatefulWidget> createState() {
    return AppComponentState();
  }
}

class AppComponentState extends State<Application> {
  @override
  Widget build(BuildContext context) {
    final app = ScopedModel(
      model: AuthLoginModel(),
      child: ScopedModel(
          model: FilterBarModel(),
          child: GetMaterialApp(
            initialRoute: Routes.splash,
            home: const HomePage(),
            title: 'Fluro',
            debugShowCheckedModeBanner: false,
            theme: ThemeData(
              primarySwatch: Colors.green,
            ),
            onGenerateRoute: Routes.router?.generator,
          )),
    );
    return app;
  }
}
